package com.dvt.faceScan;

import android.content.Context;
import android.content.SharedPreferences;

public class SharePreferenceUtil {
    private SharedPreferences sp;
    private SharedPreferences.Editor editor;

    public SharePreferenceUtil(Context context, String name) {
        sp = context.getSharedPreferences(name, context.MODE_PRIVATE);
        editor = sp.edit();
    }

    // 用户的密码
    public void setPasswd(String passwd) {
        editor.putString("passwd", passwd);
        editor.commit();
    }

    public String getPasswd() {
        return sp.getString("passwd", "");
    }

    // 用户的账号
    public void setAccount(String account) {
        editor.putString("account", account);
        editor.commit();
    }

    public String getAccount() {
        return sp.getString("account", "");
    }

    public void setIp(String ip) {
        editor.putString("ip", ip);
        editor.commit();
    }

    public String getIp() {
        return sp.getString("ip", "");
    }

    public void setPort(String port) {
        editor.putString("port", port);
        editor.commit();
    }

    public String getPort() {
        return sp.getString("port", "");
    }

    public void setRemberFlag(String remberFlag) {
        editor.putString("remberFlag", remberFlag);
        editor.commit();
    }

    public String getRemberFlag() {
        return sp.getString("remberFlag", "");
    }

}
